<template>
    <h3>自定义事件</h3>
    <button @click="sendClickHandle"> 点击发送</button>
</template>

<script>
export default {
    name: "MyComponent3",
    data() {
        return {
            message:"我是MyComponent数据"
        }
    },
    methods: {
        sendClickHandle(){
            // 参数1：字符串
            // 参数2：传递的数据
            this.$emit("onEvent",this.message)
        }
    }

}

</script>
<style scoped></style>